package com.guigu.controller;

import com.guigu.service.RegionService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/region/")
public class RegionController {
    @Autowired
    RegionService regionService;

    //根据pid，获取多个区
    @PostMapping("queryByPid.action")
    @CrossOrigin
    public List queryByPid(Integer id)
    {
        return regionService.queryByPid(id);
    }
}
